<template>
	<view @touchmove.stop.prevent="() => {}">
		<!-- 求职者 -->
		<view class="mytop" :key="UserInfo.HeadIcon">
			<view class="myIcon">
				<view class="mytoptedxttop">
					<image src="/static//image/my/saoma1.png" class="imgecr" @click="scanCode"></image>
					<image src="/static/image/my/qh1.png" @click="switchIdentity" class="imgecr">
					</image>
				</view>
			</view>

			<view class="mytopnrtext">
				<view class="mytoxiang" @click="imageclick">
					<!-- <u-avatar :src="URL + UserInfo.HeadIcon" mode="widthFix" shape="circle" :size="55"></u-avatar> -->
					<!-- <image src="/static/image/my/txx.png" class="imgestox"></image> -->
					<view :style="{'background-image':`url(${URL}${ UserInfo.HeadIcon})`}" class="imgestox"></view>
				</view>

				<view>
					<view class="fl-t">
						<text class="mytopnrtext_name">
							{{ UserInfo.RealName ? UserInfo.RealName : UserInfo.UserName }}
						</text>
						<text class="textzcr"> 求职者 </text>
						<image src="/static/image/my/qzvip.png" v-if="UserInfo.HasVip" class="imgee"></image>
					</view>
					<view class="fl-t" style="padding-top: 20rpx" v-if="qiuzhizhuangtai" @click="OnlineResume(1)">
						<text class="edit">{{ qiuzhizhuangtai }}</text>
						<image src="/static/image/my/bianji.png" class="editimg"></image>
					</view>
				</view>

				<!-- 	<view class="mytoxiang" @click="imageclick">
					<u-avatar :src="URL+UserInfo.HeadIcon" shape="circle" :size="55"></u-avatar>
					<image src="/static/image/my/txx.png" class="imgestox"></image>
				</view> -->
			</view>
		</view>
		<view class="work-area">
			<view class="fl-c-c">
				<view class="name" @click="goutongguo">沟通过</view>
				<view class="num fl-c">{{ lsitResult.JobRecordCount }}</view>
			</view>
			<view class="fl-c-c" @click="ResumeSubmitted">
				<view class="name">求职反馈</view>
				<view class="num fl-c">{{ lsitResult.FeedBackCount }}</view>
			</view>
			<view class="fl-c-c" @click="interview">
				<view class="name">待面试</view>
				<view class="num fl-c">{{ lsitResult.InterviewCount }}</view>
			</view>
			<view class="fl-c-c" @click="beInterested">
				<view class="name">感兴趣</view>
				<view class="num fl-c">{{ lsitResult.JobCollectionCount }}</view>
			</view>
		</view>
		<view class="sjvipBtn">
			<view class="shengjibg">
				<view class="shengjileft">
					<view class="viptext">
						<image src="/static/image/my/vip.png" class="vipimge"></image>
						<text>升级VIP</text>
					</view>
					<view class="vipjieshao"> 开通会员享专属特权 </view>
				</view>
				<view @click="goBuyVip" class="btn">
					<text>{{ UserInfo.HasVip ? "续费" : "去升级" }}</text>
				</view>
			</view>

			<view class="fl-sb mytextnrtop1">
				<view class="mytextnrtop1text" @click="goDosingPackage(22001)">
					<image src="/static/image/my/sx.png" class="imges1"></image>
					<view>
						<text class="text">刷新简历</text>
						<view style="font-size: 24rpx; color: #000000" v-if="UserResumeInfo">
							限免{{ UserResumeInfo.RefreshSurplus }}次</view>
					</view>

					<image src="/static/image/my/zyb2.png" class="imges2"></image>
				</view>
				<view class="mytextnrtop1text1" @click="goDosingPackage(22002)">
					<image src="/static/image/my/zd.png" class="imges1"></image>
					<view>
						<text class="text"> 置顶简历 </text>
						<view style="font-size: 20rpx" v-if="UserResumeInfo">限免{{ UserResumeInfo.StickSurplus }}次</view>
					</view>

					<image src="/static/image/my/zyb.png" class="imges2"></image>
				</view>
			</view>
		</view>

		<view class="mytextbox">
			<view class="textbox">
				<view class="mytext">
					<view class="mytextitem" @click="OnlineResume(1)">
						<view class="box">
							<u-badge shape="horn" :type="'error'" :value="UserResumeInfo.CompletePercent + '%'"
								v-if="UserResumeInfo"></u-badge>
						</view>
						<image src="/static/image/my/zaixianjl.png" class="tupian"></image>
						<view class="text"> 在线简历</view>
					</view>
					<view class="mytextitem" @click="OnlineResume(2)">
						<image src="/static/image/my/fujianjl.png" class="tupian"></image>
						<view class="text"> 附件简历</view>
					</view>
					<view class="mytextitem" @click="OnlineResume(3)">
						<image src="/static/image/my/qiuzhiyx.png" class="tupian"></image>
						<view class="text"> 求职意向</view>
					</view>
					<view class="mytextitem" @click="OnlineResume(8)">
						<image src="/static/image/my/wodekc.png" class="tupian"></image>
						<view class="text"> 我的课程</view>
					</view>
					<view class="mytextitem" @click="OnlineResume(9)">
						<image src="/static/image/my/wodekc.png" class="tupian"></image>
						<view class="text"> 优惠券</view>
					</view>

				</view>
			</view>
		</view>
		<!-- 
		<view class="hxrbox">
			<view class="huixr">
				<view class="hxrtext">Hi!我是慧星人</view>
				<view class="jianjie">我可以回答你的问题，为你提供有用信息哦~</view>
				<view class="btn">
					<view>去聊天</view>
				</view>
			</view>
		</view>
 -->

		<view class="mytextbox">
			<view class="textbox">
				<view class="qita">其他功能</view>
				<view class="mytext" style="padding: 33rpx 0 40rpx">
					<view class="mytextitem" @click="OnlineResume(4)">
						<image src="/static/image/my/sz.png" class="tupian1" style="width: 44rpx; height: 40rpx">
						</image>
						<view class="text" style="padding-top: 0"> 设置</view>
					</view>
					<view class="mytextitem" @click="OnlineResume(5)">
						<image src="/static/image/my/yszc.png" class="tupian1"></image>
						<view class="text" style="padding-top: 0">隐私与规则</view>
					</view>

					<view class="mytextitem" @click="OnlineResume(6)">
						<image src="/static/image/my/fkwt.png" class="tupian1"></image>
						<view class="text" style="padding-top: 0"> 问题反馈</view>
					</view>
					<view class="mytextitem" @click="OnlineResume(7)">
						<image src="/static/image/my/guyuwm.png" class="tupian1"></image>
						<view class="text" style="padding-top: 0"> 关于我们</view>
					</view>
				</view>
			</view>
		</view>


	</view>
</template>

<script>
	export default {
		props: {

			UserInfo: {
				type: Object,
			},

			lsitResult: {
				type: Object,
			},
			qiuzhizhuangtai: {
				type: String,
			},
			UserResumeInfo: {
				type: Object,
			},
			promptDatalist: {
				type: Array,
			},
		},
		data() {
			return {
				type: uni.getStorageSync("type"),
				URL: this.$config.domain.staticUrl,
				// promptDatalist: [],
				mode: "bottom",
				showrenzheng: false,
				UserId: "", //用户id
			};
		},
		components: {},
		created() {
			const app = getApp();
			this.UserId = app.globalData.user.UserId;
		},
		mounted() {},
		watch: {

		},

		computed: {},

		methods: {

			imageclick() {
				uni.navigateTo({
					url: "/pages/views/packageB/type-jobhunting/jibenshezhi/jibenziliao/index",
				});
			},


			ResumeSubmitted() {
				uni.navigateTo({
					url: "/pages/views/packageB/type-jobhunting/JobFeedback/JobFeedback",
				});
			},
			interview() {
				uni.navigateTo({
					url: "/pages/views/packageB/type-jobhunting/interview/interview",
				});
			},
			beInterested() {
				uni.navigateTo({
					url: "/pages/views/packageB/type-jobhunting/beInterested/beInterested",
				});
			},
			// 沟通过
			goutongguo() {
				uni.navigateTo({
					url: "/pages/views/packageB/type-jobhunting/goutongguo",
				});
			},
			// 扫码登录
			scanCode() {
				this.$emit("ClickscanCode");
			},
			switchIdentity() {
				// this.$emit("switchIdentity");
				uni.navigateTo({
					url: "/pages/My/JumpPage?type=" + this.type
				})
			},
			// 购买VIP
			goBuyVip() {
				let HasVip = this.UserInfo.HasVip;
				uni.navigateTo({
					url: "/pages/views/packageB/type-jobhunting/upgradevip/upgradevip?HasVip=" +
						HasVip,
				});
			},
			goDosingPackage(type) {
				uni.navigateTo({
					url: "/pages/views/packageB/type-jobhunting/DosingPackage/dosingPackage?type=" + type
				})
			},
			// 刷新简历
			RefreshResume() {
				this.$http.huirc
					.actionsRefreshTime({
						resumeId: this.UserResumeInfo.Id,
						searchType: 8,
						userId: this.UserId,
					})
					.then((res) => {
						if (res.Success) {
							this.$util.currentUser().then((res) => {
								this.UserResumeInfo = uni.getStorageSync("homelist").UserResumeInfo;
							});
						}
					});
			},
			// 置顶简历
			topResume() {
				this.$http.huirc
					.actionsRefreshTime({
						resumeId: this.UserResumeInfo.Id,
						searchType: 9,
						userId: this.UserId,
					})
					.then((res) => {
						if (res.Success) {
							this.$util.currentUser().then((res) => {
								this.UserResumeInfo =
									uni.getStorageSync("homelist").UserResumeInfo;
							});
						}
					});
			},
			OnlineResume(type) {
				if (type == 1) {
					uni.navigateTo({
						url: "/pages/views/packageB/type-jobhunting/resume/resume",
					});
				} else if (type == 2) {
					uni.navigateTo({
						url: "/pages/views/packageB/type-jobhunting/enclosure",
					});
				} else if (type == 3) {
					uni.navigateTo({
						url: "/pages/views/packageB/type-jobhunting/jobIntention",
					});
				} else if (type == 4) {
					uni.navigateTo({
						url: "/pages/views/packageB/type-jobhunting/jibenshezhi/index",
					});
				} else if (type == 5) {
					uni.navigateTo({
						url: "/pages/views/packageB/type-jobhunting/PrivacyAndRules/index",
					});
				} else if (type == 6) {
					uni.navigateTo({
						url: "/pages/views/packageB/type-jobhunting/feedback/feedback",
					});
				} else if (type == 7) {
					uni.navigateTo({
						url: "/pages/views/packageB/type-jobhunting/AboutAs/AboutAs",
					});
				} else if (type == 8) {
					uni.navigateTo({
						url: "/pages/views/packageB/type-jobhunting/MyCourse/myCourse",
					});
				} else if (type == 9) {
					uni.navigateTo({
						url: "/pages/views/packageB/type-jobhunting/coupon/coupon",
					});
				}
			},
		},
	};
</script>

<style lang="scss" scoped>
	.mytop {
		background-image: url("/static/image/my/bg1.png");
		background-repeat: no-repeat;
		background-size: cover;
		// padding: 1rpx 30rpx 30rpx;
		width: 100%;
		height: 379rpx;

		.myIcon {
			display: flex;
			// margin-top: 30rpx;
			padding-top: 116rpx;
			width: 100%;

			.mytoptedxttop {
				width: 100%;
				// height: 56rpx;
				// padding-top: 90rpx;
				display: flex;
				justify-content: flex-end;
				// margin-bottom: 20rpx;
				// margin-right: 1rpx;

				.imgecr {
					// padding: 0 32rpx;
					width: 38rpx;
					height: 38rpx;
					margin-left: 10rpx;
					margin-right: 30rpx;
				}
			}
		}

		.mytopnrtext {
			padding: 40rpx 10rpx;
			margin: 0 40rpx;
			display: flex;
			align-items: center;

			.mytopnrtext_name {
				font-size: 42rpx;
				font-weight: bold;
			}

			.textzcr {
				font-size: 22rpx;
				font-weight: 500;
				color: #476df0;
				padding: 5rpx 20rpx;
				margin-left: 20rpx;
				border-radius: 10rpx;
				border: 1px solid #476df0;
			}

			.imgee {
				width: 76rpx;
				height: 24rpx;
				margin-left: 21rpx;
			}

			.edit {
				color: #8f93a0;
				font-size: 30rpx;
			}

			.editimg {
				margin-left: 20rpx;
				width: 24rpx;
				height: 24rpx;
			}

			.mytoxiang {
				position: relative;
				margin-right: 20rpx;

				.imgestox {
					width: 110rpx;
					height: 110rpx;
					// position: absolute;
					border-radius: 50%;
					top: 80rpx;
					background-repeat: no-repeat;
					background-size: cover;
				}
			}
		}
	}

	.work-area {
		width: 100%;
		padding: 0 58rpx;
		box-sizing: border-box;
		display: flex;
		justify-content: space-between;

		.num {
			font-size: 36rpx;
			font-weight: bold;
			color: #000000;
		}

		.name {
			font-size: 24rpx;
			font-weight: 500;
			color: #8f93a0;
		}
	}

	.sjvipBtn {
		padding: 20rpx 30rpx;

		.shengjibg {
			background-image: url("@/static/image/my/vipbg.png");
			background-repeat: no-repeat;
			background-size: cover;
			display: flex;
			border-radius: 20rpx 20rpx 0 0;
			display: flex;
			justify-content: space-between;
			padding: 10px 20px;
			align-items: center;

			.shengjileft {
				.viptext {
					padding: 10rpx 0;

					.vipimge {
						width: 27.8rpx;
						height: 24rpx;
						margin-right: 9rpx;
					}

					text {
						font-size: 30rpx;
						font-weight: bold;
						color: #f5c1a5;
					}
				}

				.vipjieshao {
					font-size: 24rpx;
					font-weight: 400;
					color: #ffffff;
					padding: 10rpx 0;
				}
			}

			.btn {
				background: linear-gradient(90deg, #feede5 0%, #f5c4a9 100%);
				border-radius: 31rpx 31rpx 31rpx 31rpx;
				opacity: 1;
				text-align: center;

				text {
					font-size: 24rpx;
					font-weight: bold;
					color: #563726;
					padding: 15rpx 30rpx;
					display: flex;
					justify-content: center;
					flex-direction: column;
					align-items: center;
				}
			}
		}

		.mytextnrtop1 {
			background-color: #ffffff;
			border-radius: 0 0 10px 10px;
			// border-radius: 10px;

			.mytextnrtop1text {
				flex: 1;
				margin: 20rpx;
				padding: 20rpx 10rpx;
				vertical-align: middle;
				background: rgba(246, 249, 255, 0.52);
				border-radius: 14rpx;
				display: flex;
				justify-content: space-evenly;
				align-items: center;

				.imges1 {
					width: 29rpx;
					height: 29rpx;
				}

				.text {
					padding: 0rpx 20rpx 0rpx 5rpx;
					font-weight: bold;
					font-size: 26rpx;
					font-weight: bold;
					color: #000000;
				}

				.imges2 {
					width: 40rpx;
					height: 50rpx;
				}
			}

			.mytextnrtop1text1 {
				flex: 1;
				margin: 20rpx;
				padding: 20rpx 10rpx;
				vertical-align: middle;
				background: rgba(255, 245, 245, 0.52);
				border-radius: 14rpx 14rpx 14rpx 14rpx;
				display: flex;
				justify-content: space-evenly;
				align-items: center;

				.imges1 {
					width: 29rpx;
					height: 29rpx;
				}

				.text {
					padding: 0rpx 20rpx 0rpx 5rpx;
					font-weight: bold;
					font-size: 26rpx;
					font-weight: bold;
					color: #000000;
				}

				.imges2 {
					width: 40rpx;
					height: 50rpx;
				}
			}
		}
	}

	.mytextbox {
		padding: 0rpx 30rpx 20rpx;

		.textbox {
			background-color: #ffffff;
			border-radius: 20rpx;

			.qita {
				font-size: 28rpx;
				font-weight: bold;
				color: #000000;
				padding: 20rpx 20rpx 0;
			}

			.mytext {
				display: flex;
				justify-content: space-around;
				align-items: center;
				text-align: center;
				padding: 63rpx 0 32rpx;

				.mytextitem {
					position: relative;

					.box {
						position: absolute;
						right: -30rpx;
						top: -30rpx;
					}

					.tupian {
						width: 48rpx;
						height: 48rpx;
					}

					.tupian1 {
						width: 44rpx;
						height: 44rpx;
					}

					.text {
						font-size: 26rpx;
						font-weight: 400;
						color: #000026;
						padding-top: 20rpx;
					}
				}
			}
		}
	}

	.hxrbox {
		padding: 0 30rpx 20rpx;

		.huixr {
			background-image: url("@/static/image/my/huixr.png");
			background-repeat: no-repeat;
			background-size: cover;
			padding: 36rpx 40rpx;
			border-radius: 20rpx;

			.hxrtext {
				font-size: 30rpx;
				font-weight: bold;
				color: #1a2138;
			}

			.jianjie {
				font-size: 24rpx;
				font-weight: 400;
				color: rgba(0, 0, 0, 0.5);
				padding: 7rpx 0 31rpx;
			}

			.btn {
				width: 154rpx;
				height: 56rpx;
				background: #3476fe;
				border-radius: 28rpx;
				opacity: 1;
				// padding: 8rpx 38rpx;
				text-align: center;

				view {
					font-size: 28rpx;
					font-weight: 400;
					color: #ffffff;
					line-height: 56rpx;
				}
			}
		}
	}

	.upopup {
		padding: 20rpx 50rpx;
		// width: 600rpx;
		text-align: center;

		.upopuptop {
			padding: 20rpx;
			font-size: 36rpx;
		}

		.upopupnr {
			margin: 30rpx 0rpx;
			height: 300rpx;
			overflow-y: auto;

			.upopupnrtext {
				padding: 10rpx 40rpx;
				display: flex;
				justify-content: inherit;
				align-items: center;

				.imgestext {
					width: 40rpx;
					height: 40rpx;
				}

				.nartext {
					padding: 10rpx 20rpx;
					font-size: 34rpx;
					overflow: hidden;
					white-space: nowrap;
					text-overflow: ellipsis;
					width: 64%;
					text-align: left;
				}

				.status1 {
					color: #165dff;
					border-radius: 10rpx;
					padding: 5rpx 20rpx;
					font-size: 24rpx;
					background-color: #f2f2f2;
				}

				.status2 {
					color: #00000085;
					border-radius: 10rpx;
					padding: 5rpx 20rpx;
					font-size: 24rpx;
					background-color: #f2f2f2;
				}

				.imgrz {
					width: 108rpx;
					height: 32rpx;
				}
			}
		}

		.but {
			.upopupnrbut {
				padding: 24rpx 32rpx;
				background-color: #1684fc;
				border-radius: 10rpx;
				color: #ffffff;
				display: inline-block;
				width: 90%;
			}
		}
	}

	.popupShow {
		overflow: hidden;
		position: fixed;
		height: 100%;
		width: 100%;
	}
</style>